<%--
  Created by IntelliJ IDEA.
  User: wangbin
  Date: 2015/3/3
  Time: 9:33
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ include file="../inc/taglibs.jsp" %>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <%@ include file="../inc/meta.jsp" %>
    <meta name="description" content="">
    <meta name="author" content="">
    <title>客户详情</title>
    <%@ include file="../inc/css.jsp" %>
</head>
<body>

<div id="posts" class="wrapper">

    <%@ include file="../inc/nav.jsp" %>

    <div id="page-wrapper">
        <div class="row">
            <div class="col-lg-12">
                <h1 class="page-header">客户详情</h1>
                <div class="panel-heading">
                    <a href="admin/customer/index" class="btn btn-outline btn-primary btn-lg"
                       role="button"><i class='fa fa-reply'></i> 返回</a>
                </div>
            </div>
            <!-- /.col-lg-12 -->
        </div>
        <div class="row">
            <div class="col-lg-12">
                <div class="panel panel-default">
                    <!-- /.panel-heading -->
                    <div class="panel-heading">
                        客户信息
                    </div>
                    <div class="panel-body">
                        <form method="post" class="form-horizontal" role="form">

                            <div class="form-group">
                                <label class="col-sm-1 control-label" >需求号：</label>
                                <label class="col-sm-1 control-label" style="font-weight: normal;text-align: left;">${customer.demandNo}</label>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-1 control-label" >姓名：</label>
                                <label class="col-sm-1 control-label" style="font-weight: normal;text-align: left;">${customer.name}</label>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-1 control-label">电话：</label>
                                <label class="col-sm-1 control-label" style="font-weight: normal;text-align: left;">${customer.mobile}</label>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-1 control-label" >qq：</label>
                                <label class="col-sm-1 control-label" style="font-weight: normal;text-align: left;">${customer.qq}</label>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-1 control-label" >微信：</label>
                                <label class="col-sm-1 control-label" style="font-weight: normal;text-align: left;">${customer.wechat}</label>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-1 control-label" >邮箱：</label>
                                <label class="col-sm-1 control-label" style="font-weight: normal;text-align: left;">${customer.email}</label>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-1 control-label" >地域：</label>
                                <label class="col-sm-1 control-label" style="font-weight: normal;text-align: left;">${customer.region}</label>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-1 control-label" >来源：</label>
                                <label class="col-sm-1 control-label" style="font-weight: normal;text-align: left;">${customer.wechat}</label>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-1 control-label" >行业信息：</label>
                                <label class="col-sm-6 control-label" style="font-weight: normal;text-align: left;">${customer.industryInfo}</label>
                            </div>

                            <c:forEach items="${demandList}" var="demand" varStatus="vs">
                                <c:if test="${vs.last}">
                                <div class="form-group">
                                    <label class="col-sm-1 control-label" >下次联系时间：</label>
                                    <label class="col-sm-1 control-label" style="font-weight: normal;text-align: left;">
                                        <c:if test="${demand.nextTime == null}">
                                            暂无
                                        </c:if>
                                        <c:if test="${demand.nextTime != null}">
                                            <jsp:useBean id="nextValueInfo" class="java.util.Date"/>
                                            <jsp:setProperty name="nextValueInfo" property="time" value="${demand.nextTime}"/>
                                            <fmt:formatDate value="${nextValueInfo}" pattern="yyyy-MM-dd"/>
                                        </c:if>
                                    </label>
                                </div>

                                <div class="form-group">
                                    <label class="col-sm-1 control-label" >最后联系时间：</label>
                                    <label class="col-sm-2 control-label" style="font-weight: normal;text-align: left;">
                                        <jsp:useBean id="dateValueInfo" class="java.util.Date"/>
                                        <jsp:setProperty name="dateValueInfo" property="time" value="${demand.createDate}"/>
                                        <fmt:formatDate value="${dateValueInfo}" pattern="yyyy-MM-dd HH:mm"/>
                                    </label>
                                </div>
                                </c:if>
                            </c:forEach>

                        </form>
                    </div>
                    <!-- /.panel-body -->

                </div>
                <!-- /.panel -->
            </div>
        </div>

        <div class="row">
            <div class="col-lg-12">
                <div class="panel panel-default">
                    <!-- /.panel-heading -->
                    <div class="panel-heading">
                        需求描述
                    </div>
                    <div class="panel-body">
                        <div class="panel-group" id="accordion">
                            <c:forEach items="${demandList}" var="demand">
                            <div class="panel
                            <c:if test="${demand.grade == 'A'}">panel-red</c:if>
                            <c:if test="${demand.grade == 'B'}">panel-yellow</c:if>
                            <c:if test="${demand.grade == 'C'}">panel-green</c:if>
                            <c:if test="${demand.grade == 'D'}">panel-info</c:if>
                            <c:if test="${demand.grade == 'FAIL'}">panel-default</c:if>
                            ">
                                <div class="panel-heading">
                                    等级：
                                    <c:if test="${demand.grade != 'FAIL'}">${demand.grade}</c:if>
                                    <c:if test="${demand.grade == 'FAIL'}">战败</c:if>
                                </div>
                                <div class="panel-body">
                                        ${demand.description}
                                </div>
                                <div class="panel-footer" style="text-align: right">
                                    下次联系时间：
                                    <c:if test="${demand.nextTime == null}">
                                        暂无
                                    </c:if>
                                    <c:if test="${demand.nextTime != null}">
                                    <jsp:useBean id="nextValue" class="java.util.Date"/>
                                    <jsp:setProperty name="nextValue" property="time" value="${demand.nextTime}"/>
                                    <fmt:formatDate value="${nextValue}" pattern="yyyy-MM-dd"/>
                                    </c:if>
                                    &nbsp;&nbsp;
                                    编辑时间：
                                    <jsp:useBean id="dateValue" class="java.util.Date"/>
                                    <jsp:setProperty name="dateValue" property="time" value="${demand.createDate}"/>
                                    <fmt:formatDate value="${dateValue}" pattern="yyyy-MM-dd HH:mm"/>
                                </div>
                            </div>
                            </c:forEach>
                        </div>
                        <c:if test="${session_globle_member.roleId != 2}">
                            <button type="button" class="btn btn-primary" onclick="$customer.fn.addDemand()">新增需求</button>
                        </c:if>
                    </div>
                    <!-- /.panel-body -->

                </div>
                <!-- /.panel -->
            </div>
        </div>

    </div>
    <!-- /#page-wrapper -->

</div>
<!-- /#wrapper -->

<!-- 配置文件 -->

</body>

<%@ include file="../inc/footer.jsp" %>
<script>
    $customer = {
        v: {
            list: [],
            chart: null,
            dTable: null
        },
        fn: {
            init: function () {

            },
            addDemand:function(){
                window.location.href = "${contextPath}/admin/customer/addDemand?customerId=${customer.id}";
            }
        }
    }
    $(function () {
        $customer.fn.init();
    })
</script>

</html>